
** Loading data - generated in dofile: data05
use "$data\minwage_data5_estimation_2012_2015.dta", clear
keep if inrange(tline,-24,24) & apprentice == 0 // 49 event-month oberservation window & excluding apprentices

drop calc_hrly_wage // This is the trimmeed version - for descriptive purposes we show the raw imputations
rename calc_hrly_wage_raw calc_hrly_wage

** Collapsing to calculate quantiles
collapse ///
		(p10) calc_hrly_wage_p10 = calc_hrly_wage (p20) calc_hrly_wage_p20 = calc_hrly_wage ///
		(p30) calc_hrly_wage_p30 = calc_hrly_wage ///
		(p40) calc_hrly_wage_p40 = calc_hrly_wage (p50) calc_hrly_wage_p50 = calc_hrly_wage ///
		(p60) calc_hrly_wage_p60 = calc_hrly_wage (p70) calc_hrly_wage_p70 = calc_hrly_wage ///
		(p80) calc_hrly_wage_p80 = calc_hrly_wage (p90) calc_hrly_wage_p90 = calc_hrly_wage ///	
		, by(tline)

** Figure A.2. Quantiles of Imputed Hourly Wages Around Workers' 18th Birthday
two connected calc_hrly_wage_p10- calc_hrly_wage_p90 tline if inrange(tline, -24, 24), ///
	color(black gs2 gs3 gs5 gs6 gs7 gs8 gs10 gs12) msymbol(O D T S + X Oh Dh Th) ///
	graphregion(color(white)) ///
	yti("Hourly wage (DKK)") ylabel(0(25)200) xline(-12, lcolor(grey)) xline(0, lcolor(grey)) xline(12, lcolor(grey)) ///
	xti("Month relative to 18th Birthday") xlabel(-24(2)24) ///
	legend(label(1 "Ptile10") label(2 "Ptile20") label(3 "Ptile30") ///
		label(4 "Ptile40") label(5 "Ptile50") label(6 "Ptile60") ///
		label(7 "Ptile70") label(8 "Ptile80") label(9 "Ptile90") cols(5) region(lcolor(white))) scale(0.80)  
graph export "$out\Apndx_Figure2_excl_apprentices_hrly_wage_ptile_dofile_descrp02.png", width(800) height(600) replace
